import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class StudentTest4 {
    public static void main(String[] args) throws IOException {
        List<Student> list = new ArrayList<>();
      list.add(new Student("张三", "男", "20", "88"));
        list.add(new Student("李四","女","19","99"));


        FileWriter fw = new FileWriter("D:/ideamokuai/Day09/Student.txt");


        for (int i = 0; i < list.size(); i++) {
            fw.write(list.get(i).getName());
            fw.write(",");
            fw.write(list.get(i).getSex());
            fw.write(",");
            fw.write(list.get(i).getAge());
            fw.write(",");
            fw.write(list.get(i).getScores());
            fw.write("\r\n");
        }



        fw.close();





    }


}
